import React, {Component} from 'react';
import './index.less';
import {bindAction, bindModel, render} from 'react-division';

import Action from './Action';
import Model from './Model';
import confirmFormCreate from '../../../src/components/ConfigForm';
import {Space, Button} from 'antd';

bindModel({
    proInfoM: Model
});
bindAction({
    proInfoA: Action
});

const ProjectInfoForm = confirmFormCreate({modelName: 'proInfoM', actionName: 'proInfoA'});

export default render({
    models: ['proInfoM'],
    actions: ['proInfoA']
})(class ProjectInfo extends Component {
    constructor(props) {
        super(props);
    }

    render() {

        const {action} = this.props;

        return (
            <div className="project-info">
                <ProjectInfoForm />
                <div className="project-btn">
                    <Button
                        type="primary"
                        onClick={action.proInfoA.savePro}
                    >
                        保存
                    </Button>
                </div>
            </div>
        );
    }
});